package cn.wolfcode.shop.web.result;

import cn.wolfcode.shop.common.CodeMsg;

import java.text.MessageFormat;

public class MemberServerCodeMsg extends CodeMsg{


    public MemberServerCodeMsg() {
        super();
    }

    public MemberServerCodeMsg(Integer code, String msg) {
        super(code, msg);
    }

    public static final MemberServerCodeMsg LOGIN_ERROR = new MemberServerCodeMsg(500101, "账号或密码错误");

    public static final MemberServerCodeMsg OP_ERROR = new MemberServerCodeMsg(500102, "非法操作");

    public static final MemberServerCodeMsg PARAM_ERROR = new MemberServerCodeMsg(500103, "参数校验异常:{0}");

    public CodeMsg fillArgs(Object... args){
        return new MemberServerCodeMsg(this.getCode(), MessageFormat.format(this.getMsg(), args));
    }

}
